package com.xh.demo.client;

import com.github.lianjiatech.retrofit.spring.boot.annotation.Intercept;
import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.xh.demo.commons.model.Result;
import com.xh.demo.model.table.User;
import com.xh.demo.retrofit.interceptor.TimestampInterceptor;
import retrofit2.http.*;

@RetrofitClient(baseUrl = "${retrofit.api.baseUrl}")
@Intercept(handler = TimestampInterceptor.class, include = {"/timestamp/**"}, exclude = "/api/test/savePerson")
public interface InterceptorHttpApi {

    @GET("timestamp/user/{id}")
    Result<User> getUserTimestamp(@Path("id") Long id);

    @POST("savePerson")
    Result<User> savePerson(@Body User person);
}